home *** CD-ROM | disk | FTP | other *** search
- ;; require.mut : Lisp like require. This code lets Mutt programs require
- ;; that certain modules or routines be loaded.
- ;; To use: In the MAIN rouine of your program file, add
- ;; (require Mutt-module-needed-by-this-program .mco-file-module-is-in)
- ;; where:
- ;; Mutt-module-needed-by-this-program is the name of a routine in the
- ;; module.
- ;; .mco-file-module-is-in is the name of the file that contains the
- ;; code for the module.
- ;; For example: If MAIN contains (require "foo" "bar.mut") or (require
- ;; "foo" "bar")), when your program is loaded it will load foo.mco if it
- ;; hasn't been already or routine foo is not present.
- ;; Notes:
- ;; It would be a good idea to also implememnt (provide ...) so I could
- ;; use a module name instead of mickey mousing with a routine name
- ;; (which might be screwed up by autoload). I could do this with a
- ;; list.
- ;; C Durland 10/89 redone 9/91, 8/92 Public Domain
-
- (defun
- require (string Mutt-module Mutt-code-file)
- {
- (if (pgm-exists Mutt-module) (done))
-
- (arg-prefix 42) ;; secret code to maybe load
- (if (not (load Mutt-code-file)) ;; if can't load code
- {
- (msg "require: Could not load " Mutt-code-file)
- (halt)
- })
- }
- )
-